Skip to content

Node: expose MCP server instruction policy - #2386

Draft
OllieinCanada wants to merge 1 commit into
github:mainfrom
OllieinCanada:fix/typescript-mcp-instructions-2379
Draft

Node: expose MCP server instruction policy#2386
OllieinCanada wants to merge 1 commit into
github:mainfrom
OllieinCanada:fix/typescript-mcp-instructions-2379

Conversation

@OllieinCanada

Copy link
Copy Markdown

Fixes #2379

Summary

  • expose allowAllMcpServerInstructions on the shared TypeScript session config
  • forward explicitly configured true and false values through both session.create and session.resume
  • omit the option when it is not configured, preserving the runtime's allowlist-based default

The generated session.rpc.options.update surface already supports this field. This change fills the missing public create/resume path without modifying the generated protocol types.

Security

Enabling this option broadens the session's instruction trust boundary. The public API documentation calls that out, and the SDK does not enable it by default or silently coerce an omitted value.

Tests

Deterministic mocked-transport tests cover explicit true, explicit false, and omission for both create and resume. They require no Copilot model or external service.

Local validation:

  • focused Vitest regression: 3 passed
  • TypeScript typecheck: passed
  • build: passed
  • ESLint: 0 errors (5 pre-existing warnings in untouched tests)
  • Prettier check for all three touched files: passed
  • git diff --check: passed

Signed-off-by: Oliver Slapinski <olliefromcanada@gmail.com>
@OllieinCanada
OllieinCanada requested a review from a team as a code owner August 24, 2026 03:52
@SteveSandersonMS

Copy link
Copy Markdown
Contributor

Thanks for the Node support here — the fix is clean, well-tested, and matches the existing mcpServers pattern in client.ts.

Since allowAllMcpServerInstructions already exists in the generated RPC layer for all 6 SDKs (Go, Python, Rust, .NET, Java, Node), exposing it only in Node leaves the same gap open for the other five languages — anyone setting it there today has it silently dropped, same as the bug this PR fixes for Node. Could you extend this PR to expose and forward the field consistently in C#, Python, Go, Rust, and Java as well, following the same create/resume wiring approach?

For each language, focused unit/wire-level tests covering explicit true, explicit false, and omitted (mirroring the 3 Node tests here) would be great — full E2E MCP tests aren't needed beyond that unless a particular language's test setup makes it uniquely useful.

Once all languages are covered, please mark the PR ready for review. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose and serialize allowAllMcpServerInstructions in TypeScript SDK

2 participants